{% extends 'base.html' %}
{% block content %}
<h3>用户管理</h3>
<table class="table table-bordered">
  <thead><tr><th>ID</th><th>用户名</th><th>管理员</th><th>操作</th></tr></thead>
  <tbody>
  {% for u in users %}
  <tr>
    <td>{{ u.id }}</td><td>{{ u.username }}</td>
    <td>{{ '是' if u.is_admin else '否' }}</td>
    <td><a class="btn btn-sm btn-warning"
           href="{{ url_for('toggle_admin', user_id=u.id) }}">切换</a></td>
  </tr>
  {% endfor %}
  </tbody>
</table>
{% endblock %}